/*
 * @Author: wangliang
 * @Date: 2018-05-03
 * @description: 基本信息
*/

import { apiHttp } from '../../../apiHttp';
import Api from '../../../../api/company/companyController.api';
import { CompanyDetailsDto, JsonResult } from '../../../../api/Interface';
import { CommonDto } from '../companyInterface';
export default {
    // 添加基本信息
    saveCompany: async (companyDetails: CompanyDetailsDto): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(Api.saveCompany, companyDetails);
        return res;
    },
    // 获取关联关系
    getCompanyRelationPage: async (companyRelation: CommonDto): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(Api.getCompanyRelationPage, companyRelation);
        return res;
    },
    // 获取股东信息
    getCompanyShareholderPage: async (companyShareholder: CommonDto): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(Api.getCompanyShareholderPage, companyShareholder);
        return res;
    },
    // 获取对外投资
    getCompanyOutboundInvestmentPage: async (outboundInvestment: CommonDto): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(Api.getCompanyOutboundInvestmentPage, outboundInvestment);
        return res;
    },
    // 获取基本信息
    getCompanyById: async (id: number): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(Api.getCompanyById, {companyId: id});
        return res;
    },
    // 修改基本信息
    updateCompany: async (companyDetails: CompanyDetailsDto): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(Api.updateCompany, companyDetails);
        return res;
    },
};